import { createRouter, createWebHistory } from 'vue-router';
import CreateQuestionnaire from '../components/CreateQuestionnaire.vue';
import AnswerQuestionnaire from '../components/AnswerQuestionnaire.vue';
import QuestionnaireList from '../components/QuestionnaireList.vue';

const routes = [
  {
    path: '/create',
    name: 'CreateQuestionnaire',
    component: CreateQuestionnaire
  },
  {
    path: '/answer/:id',
    name: 'AnswerQuestionnaire',
    component: AnswerQuestionnaire
  },
  {
    path: '/list',
    name: 'QuestionnaireList',
    component: QuestionnaireList
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/list'
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

export default router;